<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="format-detection" content="telephone=no">
	<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
	<title>我的</title>
	<link rel="stylesheet" type="text/css" href="../../lib/css/skin.css"/>
</head>
<body>
<div id="root">
	<div class="app_warp">
		<div class="app_head">
			<span class="left back"></span>
			<span class="name" id="page_name">艺考知识库</span>
		</div>
		<div class="app_main clearfix">
			<ul class="document_view_list clearfix"></ul>
			<a href="javascript:;" class="document_view_list_loadmore" tapmode onclick="loadData()">加载更多</a>
		</div>
	</div>
</div>

<script id="document_index_template" type="text/html">
	<%for(var i in data.knowledge){%>
	<li tapmode onclick="_$.getPage('<%:=data.knowledge[i].url%>')">
		<img src="<%:=img%>" data_src="<%:=data.knowledge[i].img%>" class="imgcache" alt="">
		<span class="name">
			<%:=data.knowledge[i].title%>
		</span>
	</li>
	<%}%>
</script>

<script>

	var number = 1,
		loadData=function(){
			_$.loading.start();
			_$.ajax({
				interface: 'knowledgeList',
				data: {
					id: api.pageParam.id,
					number: number
				},
				call: function (data) {

					data.img = _$.imgCache.default;
					_$.loading.end();
					_$.template('document_index_template', data, function (html) {
						$('.document_view_list').append(html);
						_$.imgCache.load();
					})

					if (number * data.data.strip < data.data.num) {
						number++;
					} else {
						$('.document_view_list_loadmore').hide();
					}

				}
			})
		},
		appready = function () {

			$('#page_name').text(api.pageParam.name);
			loadData();

		};

</script>
<script src="../../lib/js/config.js"></script>
<script src="../../lib/js/jquery.js"></script>
<script src="../../lib/js/common.js"></script>
</body>
</html>